#ifndef GLRENDERER_H
#define GLRENDERER_H

#include <QtOpenGL/QGLWidget>
#include <QSize>
#include "base/model.h"

class GLRenderer : public QGLWidget
{
     Q_OBJECT
public:
    GLRenderer(QWidget *parent = 0);
    void initializeGL();
    void resizeGL(int w, int h);
    void paintGL();
    void timerEvent(QTimerEvent *);
    void mouseMoveEvent(QMouseEvent *);
    void mousePressEvent(QMouseEvent *);
    void keyPressEvent(QKeyEvent *);
    void keyReleaseEvent(QKeyEvent *);
    QSize minimumSizeHint() const;
    QSize sizeHint() const;
private:
    MeshData * m_Model;
    float m_preMouseX, m_preMouseY;
    int m_W, m_H;
    bool m_PanKeyDown;
    GLenum mode;
};

#endif // GLRENDERER_H
